/**
 * 
 */
package co.fitstart.entity.product;

import com.demo2do.core.utils.Alias;

/**
 * @author Leo
 *
 */
@Alias("productTag")
public enum Tag {

    NEW("新产品", "new", "info", 100),
    
    SALE("打折", "sale", "warning", 10),
    
    HOT("热卖", "hot", "danger", 1);
    
    private String description;
    
    private String alias;
    
    private String css;
    
    private int weight;

    /**
     * @param description
     * @param alias
     * @param css
     */
    Tag(String description, String alias, String css, int weight) {
        this.description = description;
        this.alias = alias;
        this.css = css;
        this.weight = weight;
    }
    
    /**
     * 
     * @param alias
     * @return
     */
    public static Tag aliasOf(String alias) {
        for (Tag tag : Tag.values()) {
            if (tag.getAlias().equalsIgnoreCase(alias)) {
                return tag;
            }
        }
        return null;
    }
    
    /**
     * 
     * @return
     */
    public String getDescription() {
        return description;
    }
    
    /**
     * 
     * @return
     */
    public String getAlias() {
        return alias;
    }
    
    /**
     * 
     * @return
     */
    public String getCss() {
        return css;
    }
    
    public String getName() {
        return name();
    }
    
    /**
     * 
     * @return
     */
    public int getWeight() {
        return weight;
    }
}
